約 4,293,823 件
https://w.atwiki.jp/learningrails/pages/16.html
Railsで作られたCMS(Contents Management System)をいくつか試してみた。 「12 Ruby-on-Rails Content Management Systems (CMS)」を参考にCMSをいくつかためしてみることにする。 refinery cms my_refineryというディレクトリに作ってみる。 $ gem install refinerycms $ mkdir my_refinery $ refinerycms my_refinery $ cd my_refinery $ rails s http //0.0.0.0 3000/にアクセスして、初期アカウントの作成してログイン。 いきなりページ追加、編集ができるCMSとして使える。 すばらしい! casein (1) railsプロジェクトを作る (2) Gemfileにrequire casein を追加する。 (3) bundle installを実行 (4) rails g casein install (5) rails g casein updateでcssやpngファイルをコピー (6) rake db migrate (7) rake casein users create_admin email=you@yourdomain.comで管理者ユーザを追加 (8) rails s でサーバ起動 (9) http //0.0.0.0 3000/caseinを開く 管理者権限でのログインができて、ユーザーの生成などができる。 CMSとしての機能はこの段階では使えない。 めんどくさがりの俺にはここまで。 adva-cms2 gem install adva-cms2 を実行してみたら、 linecache19 (0.5.12) のインストール中で止まってしまった。 rvmからのインストールは難しいの?
https://w.atwiki.jp/hmiku/pages/23177.html
【登録タグ 曖昧さ回避】 曖昧さ回避のためのページ テラ小室Pの曲select/テラ小室P L-toneの曲SELECT/L-tone 曖昧さ回避について 曖昧さ回避は、同名のページが複数存在してしまう場合にのみ行います。同名のページは同時に存在できないため、当該名は「曖昧さ回避」という入口にして個々のページはページ名を少し変えて両立させることになります。 【既存のページ】は「ページ名の変更」で移動してください。曖昧さ回避を【既存のページ】に上書きするのはやめてください。「〇〇」という曲のページを「〇〇/作り手」等に移動する場合にコピペはしないでください。 曖昧さ回避作成時は「曖昧さ回避の追加の仕方」を参照してください。 曖昧さ回避依頼はこちら→修正依頼/曖昧さ回避追加依頼
https://w.atwiki.jp/k_rororo/pages/20.html
Rails関連 ※rails version 3.2.1 db migrateをやりなおしたい場合 1つだけ戻す場合 $ rake db migrate redo rake タスクでのデータベース作成 $ rake db create RAILS_ENV=環境
https://w.atwiki.jp/rubyocho/pages/12.html
RubyGemsの使い方 gem help commands 使い方の基本 検索 インストール リスト gem help commands GEM commands are ---------------------------------------------------------------------------- build Build a gem from a gemspec cert Adjust RubyGems certificate settings check Check installed gems cleanup Clean up old versions of installed gems in the local repository contents Display the contents of the installed gems dependency Show the dependencies of an installed gem environment Display information about the RubyGems environment help Provide help on the gem command install Install a gem into the local repository list Display all gems whose name starts with STRING outdated Display all gems that need updates pristine Restores gem directories to pristine condition from files located in the gem cache query Query gem information in local or remote repositories rdoc Generates RDoc for pre-installed gems search Display all gems whose name contains STRING sources Manage the sources RubyGems will search forgems specification Display gem specification (in yaml) uninstall Uninstall gems from the local repository unpack Unpack an installed gem to the current directory update Update the named gem (or all installed gems) in the local repository ---------------------------------------------------------------------------- For help on a particular command, use gem help COMMAND . 使い方の基本 検索 # gem search rails --remote *** REMOTE GEMS *** Bulk updating Gem source index for http //gems.rubyforge.org ajp-rails (0.1.0, 0.0.4, 0.0.3, 0.0.2, 0.0.1, 0.0.0) Ruby on Rails Runner, which uses AJP(Apache JServ Protocol) to cooperate with a HTTPd, instead of CGI or FastCGI atlas_on_rails (0.1.0) An API agnostic way of including maps within you Rails app (e.g., GoogleMaps) gemsonrails (0.4.3, 0.4.2, 0.3.0, 0.2.0) Link or freeze RubyGems into your rails apps, instead of plugins odbc-rails (1.4, 1.3, 1.2) ODBC Data Adapter for ActiveRecord. rails (1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.13.1, 0.13.0, 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.5, 0.9.4.1, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.5, 0.8.0, 0.7.0, 0.6.5, 0.6.0) Web-application framework with template engine, control-flow layer, and ORM. rails-app-installer (0.2.0, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0) An installer for Rails apps rails_analyzer_tools (1.1.0, 1.0.0) Tools for analyzing the performance of web sites. rails_env (0.1.0) description of gem rails_product (0.6, 0.5) Creates a ready-to-go productized Ruby on Rails application from a single command ( rails_product ). rails_sql_views (0.5.1, 0.5.0, 0.4.0, 0.3.0, 0.2.0, 0.1.0) Adds SQL Views to Rails. railsbench (0.9.2, 0.9.1, 0.9.0, 0.8.4) rails benchmarking tools RailsEditor (0.0.26, 0.0.25, 0.0.24, 0.0.23, 0.0.22, 0.0.21) A screen + vim IDE setup for editing a Rails tree railsmachine (0.1.2, 0.1.1, 0.1.0) The Rails Machine task library RailsRemoteControl (1.0.0) Alter Rails log levels and monitor processes without restarts インストール # gem install rails --remote Install required dependency rake? [Yn] y Install required dependency activesupport? [Yn] y Install required dependency activerecord? [Yn] y Install required dependency actionpack? [Yn] y Install required dependency actionmailer? [Yn] y Install required dependency actionwebservice? [Yn] y Successfully installed rails-1.2.3 Successfully installed rake-0.7.3 Successfully installed activesupport-1.4.2 Successfully installed activerecord-1.15.3 Successfully installed actionpack-1.13.3 Successfully installed actionmailer-1.3.3 Successfully installed actionwebservice-1.2.3 リスト # gem list *** LOCAL GEMS *** actionmailer (1.3.3) Service layer for easy email delivery and testing. actionpack (1.13.3) Web-flow and rendering framework putting the VC in MVC. actionwebservice (1.2.3) Web service support for Action Pack. activerecord (1.15.3) Implements the ActiveRecord pattern for ORM. activesupport (1.4.2) Support and utility classes used by the Rails framework. rails (1.2.3) Web-application framework with template engine, control-flow layer, and ORM. rake (0.7.3) Ruby based make-like utility. sources (0.0.1) This package provides download sources for remote gem installation
https://w.atwiki.jp/rubyocho/pages/23.html
Railsによく出るRubyの読み方 Railsによく出るRubyの読み方 app/controllers/memo_controller.rb マイグレーションファイル 001_create_memos.rb app/controllers/memo_controller.rb MemoController class MemoController ApplicationController def list @memo_pages, @memos = paginate memos, per_page = 10 end 関数を呼び出す際に使う()カッコや、ハッシュを表す||波カッコを省略可能 class MemoController ApplicationController def list (@memo_pages, @memos) = paginate( memos, | per_page = 10|) end クラス名は大文字ではじめる MemoController 「 X Y 」:Yクラスを継承して、Xクラスを定義 ApplicationControllerクラスを継承して、MemoControllerクラスを定義 MemoControllerクラスのメンバー関数(メソッド)「list()」を定義 def 関数名() 処理内容 end メソッドlistの中身 (@memo_pages, @memos) = paginate( memos, | per_page = 10|) @memo_pages @で始まる変数をインスタンス変数と呼び、インスタンス固有の変数を表す インスタンス変数は、インスタンス(オブジェクト)が生きている限り有効 Railsでは、コントラーの中からビューに渡す値を入れておくのにも、このインスタンス変数を使う paginate()関数 @memo_pages, @memosという2つの値を返している @memo_pages, @memosは、MemoControllerの中で使えるメンバー変数(プロパティ) :(コロン)で始まる名前。 memos, per_page シンボル シンボルは内部的に数字で表されるために、ハッシュの引数などで使うと効率が良い オブジェクトの名前やハッシュのキーの場合にシンボルを使う メッセージなどでは文字列を使う per_page = 10 ハッシュテーブル(連想記憶配列)を定義 「 per_page」というキー(インデックス)に「10」という値をいれて、paginate()関数の2つ目の引数に渡している。 一つの関数で複数の戻り値を持つことができる app/controllers/memo_controller.rbの中には、他に、indexやshowなど様々なメソッドが定義されている。 マイグレーションファイル 001_create_memos.rb db/migrate/001_create_memos.rb class CreateMemos ActiveRecord Migration def self.up create_table memos do |t| t.column title, string t.column body, text t.column created_at, datetime t.column update_at, datetime end end def self.down drop_table memos end end [1] ActiveRecord Migrationを継承するCreateMemosクラス [2] self.upメンバー関数を定義。self. をつけた関数は、CreateMemos.up()のように呼び出す。 [3] create_table関数を、引数 memosを与えて呼び出す create_table ( memos) do |t| create_table(引数)は、引数の名前でテーブルを生成 memosテーブルを生成し、do |t|後 [4]-[7]行目でテーブルを定義 「do-end」はブロック。ブロック付メッソッド呼び出し
https://w.atwiki.jp/knowledge_library/pages/14.html
Ruby基礎 インストール 基本構文 リテラル 変数と定数 演算子 制御構造 例外処理 メソッド呼び出し クラス・メソッド定義 組み込み関数 Rails基礎 Rubyライブラリ Railsプラグイン Rubyリファレンス
https://w.atwiki.jp/kuwa0224kuwa/pages/14.html
ruby の勉強メモ 基本 標準出力方法 puts "Hello World" # 改行あり print ("Hello", "World") # 改行なし コマンドラインの引数扱い puts ARGV[0] + " " + ARGV[1] コマンドラインのオプション扱い Option Perser を使う。 - http //www.ruby-lang.org/ja/man/html/OptionParser.html require "optparse" opts = OptionParser.new opts.on("-a"){|v| puts "indicated a." } # -a オプションがコマンドラインで指定されていた場合の動作。 opts.parse!(ARGV) if文の書き方 # Pattern 1 if city == "Tokyo" then print("東京です") elsif city == "Osaka" then print("大阪です") elsif city == "Nagoya" then print("名古屋です") else print("その他の都市です") end # Pattern 2 print("num = ", num) if debug # Pattern 3 (not if) unless old 20 then print(Kconv.tosjis("年齢は"), old, Kconv.tosjis("です\n")) print(Kconv.tosjis("20歳以上ですのでご利用できます\n")) end 繰り返し文の書き方 # while statement num = 0 while num 4 do print("num = ", num) num = num + 1 end # until statement num = 0 until num = 4 do print("num = ", num) num = num - 1 end # for statement for num in 0..3 do print("num = ", num) end エラー処理 begin puts "Execute" rescue = ex puts ex.class puts ex.message puts ex.backtarce ensure if ex then puts "Error occured" else puts "No Error" end 入力待ち print "Please any chars " line = STDIN.gets puts "input text #{line}" OSコマンド呼び出し # Pattern 1 result = `ls -l` print result # this is simplest. # result has result of command. # if error occurs, prints error. # Pattern 2 result = system("ls -lh") print result # system prints result of command(even if error). # result has true or false. # Pattern 3 begin result = exec("ls -lh") print result rescue puts "error" end # exec prints result of command(even if error). # if command is unknown, this can catch exception. # Pattern 4 result = open("|ls -l") while !result.eof print result.gets end # result has result of command # this can write. 環境変数取得 print ENV["LANG"] 設定ファイル読み込み require yaml config = YAML.load_file("config.yml") p config["dictype"][0] #= "dym" # in config.yml dictype - dym - rltd ファイル・ディレクトリ操作 ここ使える。 http //www.ruby-lang.org/ja/man/html/fileutils.html 存在確認 print File.exist?("temp.rb") ディレクトリ移動 require fileutils FileUtils.cd( /usr/local/var/log ) ディレクトリ作成 require fileutils FileUtils.mkdir_p( /usr/local/lib/ruby ) ファイル・ディレクトリコピー require fileutils FileUtils.cp_r("sample.txt", "tmp") ファイル・ディレクトリ切り取り require fileutils FileUtils.mv([ junk.txt , dust.txt ], "#{ENV[ HOME ]}/.trash") ディレクトリ削除 require fileutils FileUtils.rm( junk.txt ) 対象行抽出(grep) OSコマンドを使うのが一番。ちなみに、list からgrepで引っ張る方法はある。 p [ aa , bb , cc , dd , ee ].grep(/[bc]/) # = ["bb", "cc"] 差分 OSコマンドを使うのが一番。ちなみに、diffがあるかないかぐらいなら引っ張る方法はある。 require fileutils FileUtils.cmp( somefile , somefile ) sha1sum取得 require digest/sha1 print Digest SHA1.hexdigest(File.open( temp.rb ).read) シムリンク作成 require fileutils FileUtils.ln_s( /usr/bin/ruby , /usr/local/bin/ruby ) # original is /usr/bin/ruby その他 日付取得 day = Time.now print day.strftime("%Y/%m/%d_maint") SVNダウンロード OSコマンドを使うのが一番。 SubversionのRuby用bindingを利用することもできるらしいけど、インストール方法がよくわからん。。 CVSダウンロード OSコマンドを使うのが一番。 Httpアクセス require net/http Net HTTP.version_1_2 # おまじない Net HTTP.start( www.iana.org , 80) {|http| response = http.get( /index.html ) puts response.body } # use Proxy require net/http Net HTTP.version_1_2 # おまじない Net HTTP Proxy("your.proxy.addr", 8080).start( www.iana.org , 80) {|http| response = http.get( /index.html ) puts response.body }
https://w.atwiki.jp/m_shige1979/pages/1498.html
gemでインストール ダウンロード http //www.sqlite.org/download.htmlよりsqlite-autoconf-3071602.tar.gzをダウンロード 任意のディレクトリへ解凍する 手順 c \ set PATH=%PATH%;C \Ruby200-x64\DevKit\bin;C \Ruby200-x64\DevKit\mingw\bin c \ bash bash-3.1$ cd C /Ruby200-x64/sqlite-autoconf-3071602 bash-3.1$ pwd /c/Ruby200-x64/sqlite-autoconf-3071602 bash-3.1$ ./configure --prefix=D /Tools/sqlite3 bash-3.1$ make bash-3.1$ mkdir D /Tools/sqlite3 bash-3.1$ make install bash-3.1$ cp D /Tools/sqlite3/bin/* C /Ruby200-x64/bin bash-3.1$ exit c \ gem install sqlite3 -- --platform=ruby --with-opt-include="D /Tools/sqlite3/include" --with-opt-lib="D /Tools/sqlite3/lib" 設定ログ c \ set PATH=%PATH%;C \Ruby200-x64\DevKit\bin;C \Ruby200-x64\DevKit\mingw\bin c \ bash bash-3.1$ cd C \Ruby200-x64\sqlite-autoconf-3071602 bash cd C Ruby200-x64sqlite-autoconf-3071602 No such file or directory bash-3.1$ cd C /Ruby200-x64/sqlite-autoconf-3071602 bash-3.1$ pwd /c/Ruby200-x64/sqlite-autoconf-3071602 bash-3.1$ ./configure --prefix=D /Tools/sqlite3 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... 64 checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking for ranlib... ranlib checking build system type... i686-pc-mingw32 checking host system type... i686-pc-mingw32 checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ld used by gcc... c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe checking if the linker (c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes checking for c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r checking for BSD-compatible nm... /usr/mingw/bin/nm checking whether ln -s works... no, using cp -pR checking how to recognise dependent libraries... file_magic file format pei*-i386(.*architecture i386)? checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... no checking dlfcn.h presence... no checking for dlfcn.h... no checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for xlf... no checking for f77... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for xlf90... no checking for f90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... gfortran checking whether we are using the GNU Fortran 77 compiler... yes checking whether gfortran accepts -g... yes checking the maximum length of command line arguments... 8192 checking command to parse /usr/mingw/bin/nm output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... (cached) ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -DDLL_EXPORT checking if gcc PIC flag -DDLL_EXPORT works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes checking whether -lc should be explicitly linked in... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe checking if the linker (c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes checking whether the g++ linker (c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes checking for g++ option to produce PIC... -DDLL_EXPORT checking if g++ PIC flag -DDLL_EXPORT works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gfortran option to produce PIC... -DDLL_EXPORT checking if gfortran PIC flag -DDLL_EXPORT works... yes checking if gfortran static flag -static works... yes checking if gfortran supports -c -o file.o... yes checking whether the gfortran linker (c /ruby200-x64/devkit/mingw/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for fdatasync... no checking for usleep... yes checking for fullfsync... no checking for localtime_r... no checking for gmtime_r... no checking whether strerror_r is declared... no checking for strerror_r... no checking whether strerror_r returns char *... no checking for library containing tgetent... no checking for library containing readline... no checking for readline... no checking for library containing pthread_create... -lpthread checking for library containing dlopen... no checking for whether to support dynamic extensions... yes checking for posix_fallocate... no configure creating ./config.status config.status creating Makefile config.status creating sqlite3.pc config.status executing depfiles commands bash-3.1$ bash-3.1$ make if /bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.16.2\" -DPAC KAGE_STRING=\"sqlite\ 3.7.16.2\" -DPACKAGE_BUGREPORT=\"http //www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.16.2\ " -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DH AVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_USLEEP=1 -DHAVE_DECL_STRERROR_R=0 -I. -I. -D_REENTRANT=1 - DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF ".deps/sqlite3.Tpo" -c -o sqlite3.lo sqli te3.c; \ then mv -f ".deps/sqlite3.Tpo" ".deps/sqlite3.Plo"; else rm -f ".deps/sqlite3.Tpo"; exit 1; fi mkdir .libs gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.16.2\" "-DPACKAGE_STRING=\"sqlite 3.7.16.2\"" -DPACKAGE_ BUGREPORT=\"http //www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.16.2\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 - DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_ STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_USLEEP=1 -DHAVE_DECL_STRERROR_R=0 -I. -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQ LITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c -DDLL_EXPORT -DPIC -o .libs/sqlite3.o gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.16.2\" "-DPACKAGE_STRING=\"sqlite 3.7.16.2\"" -DPACKAGE_ BUGREPORT=\"http //www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.16.2\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 - DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_ STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_USLEEP=1 -DHAVE_DECL_STRERROR_R=0 -I. -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQ LITE_ENABLE_RTREE -g -O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c -o sqlite3.o /dev/null 2 1 /bin/sh ./libtool --tag=CC --mode=link gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -o libs qlite3.la -rpath D /Tools/sqlite3/lib -no-undefined -version-info 8 6 8 sqlite3.lo -lpthread *** Warning linker path does not have real file for library -lpthread. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libpthread and none of the candidates passed a file format test *** using a file magic. Last file checked c /ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw3 2/lib//libpthread.dll.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. copying selected object files to avoid basename conflicts... rm -fr .libs/libsqlite3.lax mkdir .libs/libsqlite3.lax ar cru .libs/libsqlite3.a sqlite3.o ranlib .libs/libsqlite3.a rm -fr .libs/libsqlite3.lax creating libsqlite3.la (cd .libs rm -f libsqlite3.la cp -pR ../libsqlite3.la libsqlite3.la) if gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.16.2\" -DPACKAGE_STRING=\"sqlite\ 3.7.16.2\" -DPACKAGE _BUGREPORT=\"http //www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.16.2\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE _STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_USLEEP=1 -DHAVE_DECL_STRERROR_R=0 -I. -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT shell.o -MD -MP -MF ".deps/shell.Tpo" -c -o shell.o shell.c; \ then mv -f ".deps/shell.Tpo" ".deps/shell.Po"; else rm -f ".deps/shell.Tpo"; exit 1; fi /bin/sh ./libtool --tag=CC --mode=link gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -o sqli te3.exe shell.o ./libsqlite3.la -lpthread gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -o sqlite3.exe shell.o ./.libs/libsqlite3.a -lpt hread bash-3.1$ bash-3.1$ make install make[1] Entering directory `/c/Ruby200-x64/sqlite-autoconf-3071602 test -z "D /Tools/sqlite3/lib" || mkdir -p -- "D /Tools/sqlite3/lib" /bin/sh ./libtool --mode=install /usr/bin/install -c libsqlite3.la D /Tools/sqlite3/lib/libsqlite3.la /usr/bin/install -c .libs/libsqlite3.lai D /Tools/sqlite3/lib/libsqlite3.la /usr/bin/install -c .libs/libsqlite3.a D /Tools/sqlite3/lib/libsqlite3.a chmod 644 D /Tools/sqlite3/lib/libsqlite3.a ranlib D /Tools/sqlite3/lib/libsqlite3.a ---------------------------------------------------------------------- Libraries have been installed in D /Tools/sqlite3/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR flag during linking and do at least one of the following - add LIBDIR to the `PATH environment variable during execution - add LIBDIR to the `LD_RUN_PATH environment variable during linking - use the `-LLIBDIR linker flag See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- test -z "D /Tools/sqlite3/bin" || mkdir -p -- "D /Tools/sqlite3/bin" /bin/sh ./libtool --mode=install /usr/bin/install -c sqlite3.exe D /Tools/sqlite3/bin/sqlite3.exe /usr/bin/install -c sqlite3.exe D /Tools/sqlite3/bin/sqlite3.exe test -z "D /Tools/sqlite3/include" || mkdir -p -- "D /Tools/sqlite3/include" /usr/bin/install -c -m 644 sqlite3.h D /Tools/sqlite3/include/sqlite3.h /usr/bin/install -c -m 644 sqlite3ext.h D /Tools/sqlite3/include/sqlite3ext.h test -z "D /Tools/sqlite3/share/man/man1" || mkdir -p -- "D /Tools/sqlite3/share/man/man1" /usr/bin/install -c -m 644 ./sqlite3.1 D /Tools/sqlite3/share/man/man1/sqlite3.1 test -z "D /Tools/sqlite3/lib/pkgconfig" || mkdir -p -- "D /Tools/sqlite3/lib/pkgconfig" /usr/bin/install -c -m 644 sqlite3.pc D /Tools/sqlite3/lib/pkgconfig/sqlite3.pc make[1] Leaving directory `/c/Ruby200-x64/sqlite-autoconf-3071602 bash-3.1$ bash-3.1$ cp D /Tools/sqlite3/bin/* C /Ruby200-x64/bin bash-3.1$ exit c \ gem install sqlite3 -- --platform=ruby --with-opt-include="D /Tools/sqlite3/include" --with-opt-lib="D /Tools/sqlite3/lib" Temporarily enhancing PATH to include DevKit... Building native extensions with --platform=ruby --with-opt-include=D /Tools/sqlite3/include --with-opt-lib=D /Tools/sqlite3/lib This could take a while... Successfully installed sqlite3-1.3.7 Parsing documentation for sqlite3-1.3.7 unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/sqlite3_native.so, skipping Installing ri documentation for sqlite3-1.3.7 1 gem installed c \ c \ ruby -e "require sqlite3 " c \
https://w.atwiki.jp/ohden/pages/279.html
Ruby Ubuntu 8.10 ruby 1.8.7 Ruby公式サイト ruby install install install(CentOS) install(.rbenv) cruby truffleruby JIT Just In Time compiler。 MJIT ruby2.6で導入されたJIT。 YJIT ruby3.1で導入された、大規模ECサイト等でパフォーマンスが出せるように最適化されたJIT。 RUBY_YJIT_ENABLE=1 debugger byebug pry debug.gem rdbg Tips vim-ruby pry設定 Ruby/tips/ RubyGems RubyOnRails 更新日: 2022年07月27日 (水) 00時59分18秒 使えるRSpec入門・その1「RSpecの基本的な構文や便利な機能を理解する」 http //qiita.com/jnchito/items/42193d066bd61c740612 使えるRSpec入門・その2「使用頻度の高いマッチャを使いこなす」 http //qiita.com/jnchito/items/2e79a1abe7cd8214caa5 使えるRSpec入門・その3「ゼロからわかるモック(mock)を使ったテストの書き方」 http //qiita.com/jnchito/items/640f17e124ab263a54dd Rubyソースコード完全解説 http //i.loveruby.net/ja/rhg/book/ -- (s1n) 2017-06-14 18 50 31 「若手エンジニア/初心者のためのRuby 2.1入門」最新記事一覧 http //www.atmarkit.co.jp/ait/kw/ruby_nyumon.html -- (s1n) 2017-06-15 13 10 39 require include exclude -- (s1n) 2017-08-10 13 18 14 Ruby documentation comment. YARD https //yardoc.org RDoc http //rdoc.sourceforge.net -- (s1n) 2018-04-23 16 37 51 "hoge".pluralize = "hoges" "hoges".singularize = "hoge" -- (s1n) 2018-08-20 11 21 19 https //blog.jnito.com/entry/2015/05/20/080306 rspecの考え方。 https //qiita.com/jnchito rspecの使い方。 https //qiita.com/jnchito/items/607f956263c38a5fec24 カピバラさん関係。 https //qiita.com/namitop/items/bf455f8383181ff6edf3 rspecアンチパターン -- (s1n) 2018-09-21 10 50 46 名前 コメント すべてのコメントを見る
https://w.atwiki.jp/maimuzo/pages/58.html
GemSpec.infoのフィーチャ コンセプトを基にフィーチャモデルをまとめてみました。 FreeMindというマインドマップを描くためのツールを使ってまとめているのですが、そのままの形で公開するのは適さないので、このWikiに内容を書き出します。(Twikiへのエクスポート機能を使っているのでなんか表現方法が変ですが・・・) ログイン * 意味合い * ユーザ管理 * 世界中かつクローンサイト通してユニークにする * IDは何かを書くときに必要。読むのは誰でも読める * いたずら防止。いたずらからのリカバリ * 必要機能 * プログラマ対象だしOpenID一本でいっかー * openid_fu_generator * パスワード認証は殺す * 簡単なプロフィールと画像ぐらい登録できた方がよさそう * attachment_fu * マスタDBにスパムだと思われるOpenIDを書けばクローンも含めて全て消されるように * OpenIDだけ指定すれば関連するモノが全て消える構造に保つ * 問題点 記事投稿 * 意味合い * PHPのオンラインマニュアルのようにコードベースを作る * (特定領域に特化しているのため)ググっても出てこないものも、ここでは見つかるようにしたい * 必要機能 * 直接書く * ベタテキスト * acts_as_commentable使える? * ユーザ管理上問題なければ * GemCasts * コンテンツのIDとコメントを入力できるようにしておいて、システム側でiframeを生成 * トラックバック * ユーザ毎にユニークなトラックバックURLを生成する(スパム対策) * ログイン状態でなければトラックバックURLは表示されない * 参照URLを登録 * 「直接書く」の一形態(参照先URLのみ書き込む)という形かなぁ * 参照先コンテンツから本文抽出はしたいかも * extractcontent(gem)を使う * 問題点 * 誰が書ける? * ログイン済みユーザのみ * どうやって管理する? * ログインにはOpenIDが必須で、スパムなどはOpenIDで検索して消す * 真偽は管理しないが、レーティングによって評価はしたい レーティングとグルーピング * 意味合い * このGemはどんな風に使うのかを明確に * 必要機能 * 1行メッセージ風にメリットとデメリットをまとめる * このGemは一言で言うと何か? * このGemを使うと何が嬉しいの? * このGemが苦手とすることは? * 愛されGemを集計 * 自分の好きなgemに+1だけできる * タグ * タグクラウド * acts_as_taggable_redux * タグで逆引き用にグルーピング * ログイン済みユーザのみ書き込み・投票可能 * 至るモノにレーティング可能 * 最終更新日とか障害状況によって総合点を付けたい * 基本的にレーティングによってソートする * default_order * 最終的にレコメンドエンジンも盛り込みたい * データが貯まるまであまり考えない * ER図だけはちょっとだけ意識して作る * 汎用的に作ってgem化したい * acts_as_ratedベースまたはacts_as_favoritベース? * 問題点 * 5つ星風だとレートが集まらないかも * 積極的にログインして投票してくれる人はごく少数 * 少数意見でレーティングされてしまうと信頼性が低くなる * 解決案 * 一度ログインしたら次回からは自動ログイン前提 * ログインしてない人にはjGrowl使って一定確率でログインを促す * あまり考えず気軽に気分で投票できるようにする * パターンは「好き」か「嫌い」のみ * 5つ星の平均を取ると、サンプル数が少ないときに信用度が低くなるので * 「一覧に戻るリンク」の代わりに「好きに投票して戻る」を使う Gemの情報 * 意味合い * 全自動・もしくは半自動的にgemの情報を集める * 過去バージョンの情報も集める * 必要機能 * gemの基本情報 * gem specificationからデータ収集 * gemやプラグインとの相性・障害情報 * 別途gemで配布できる組み合わせ情報収集用スクリプトを作っておいて、協力者が自分でRAILS_ROOTで起動する * 組み合わせ情報はYAMLとしてデータベースに蓄える * バッチで解析して、オンラインに反映する * とりあえず、今は手を付けない方が良い * 全文検索用エンジン * HyperEstrair+acts_as_searchable_redux * 定期的にgem毎に関連する情報をまとめて全文検索エンジンに突っ込み、更新する * 第2段階かなぁ * 問題点 検索機能 * 意味合い * 必要機能 * 日本語での全文検索 そのGemにひもづけられた情報全てが対象ランキングの計算が複雑かも * Gemの中身(ソースなど)の全文検索 * ライセンスでの絞り込み * レーティングでの絞り込み * Gemの最終更新日時での絞り込み * タグ検索 * 問題点 SEO対策 * 意味合い * せっかく作るからには使ってもらいたい * 動的コンテンツに対するRailsとしてのSEOノウハウを得たい * ランキング上位に、ではなく、適切なキーワードで引っかかるように * 必要機能 * GEM名で引っかかるようにマーキングする * RubyやRails、Gemなども静的キーワードとして盛り込む * RSSで更新情報を配信する * simple_rss使う? * acts_as_commentable使えるなら良いかも * サイトマップを動的生成する * sitemapを使う? * URLから内容を推測できるようにURL設計する * SEO的意味合い * アクセス解析上の意味合い * acts_as_sluggableでURLをreadableに * 問題点 逆引き * 意味合い * 同じ機能のgemが数多くあるので、使い分けに悩む * 使うより、使い分けを調べる事に時間を取られる * どうせタグでグルーピングするんだから、その中で順位を付ける * みんなでレーティングする。レーティングを促す * 自分で好きにグルーピングしてレーティングすると、きっと数も質も悪くなる * 必要機能 * 同じタグが付いているgemについて * 自分が好きなgemには+1できる * 自分が嫌いなgemには-1できる * タグの付け方に方針を付ける * 「○○とき使うgem」という形でタグを付ける * ログインするとき使うgem * RSSを作るとき使うgem * ツリー表示するとき使うgem * 分類するとき使うgem * 当然1つのgemは複数のタグをつけて良い * 問題点 * 逆引きとしてコンテンツをまとめる必要はないかも * このタグの命名規則では言語依存するよね 国際化 * 意味合い * テンプレート以外はgettext前提 * 時間はUTC * ソースへのコメントも基本英語 * 中央DBはクローンサイトからの通信のみ受け付ける * 日本やアメリカ・ヨーロッパといった比較的情報が集まりやすい国以外でも簡単に情報集約サイトを開けるようにしたい * 共有すべきは共有する * タイとかね * クローンサイト間でgemのidを合わせる必要があるので、DBの同期機能が必要 * この部分はクラサバ型にするしかないかなぁ * レーティングやレコメンドのためのサンプルも同期したい * タグ名を複数言語対応にすればクローンサイト間で共有できるかも * 「ログインするとき」なら「when authentication」とか * 「RSS作るとき」なら「when make the RSS」 * translate_columns使う? * 必要機能 * クローンサイトの管理 * IP * ドメイン名 * パスワード * クローンサイトの同じgemのページに移動できる機能 * ドメイン名を変えるだけ * 問題点 ユーザ管理機能 * 意味合い * 二重投票の防止 * 書き込み内容への責任 * 統計情報とってレコメンドエンジン作りたい * 必要機能 * お気に入りgem * acts_as_favorite? * 問題点 * ログインする意味があまりなければログインしない その他 * アクセス数を集計する * googleAnalyticsでよくね? 過去バージョンについて たぶん、後でまたアップデートされるでしょうが、その都度最新版をアップするので、過程を知りたい方はFreeMindを使って見てください。 最新 FreeMindについて FreeMindの0.90Beta20を使って描いてます。 ダウンロードするならこちらからどうぞ コメント 名前